package com.ubigate.android.qmode.main;

import com.ubigate.android.qmode.R;

import android.app.Activity;
import android.media.MediaPlayer;
import android.media.MediaPlayer.OnCompletionListener;
import android.net.Uri;
import android.os.Bundle;
import android.view.Window;
import android.widget.MediaController;
import android.widget.VideoView;

public class VideoPlayerActivity extends Activity implements OnCompletionListener {
	private VideoView videoView;
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		requestWindowFeature(Window.FEATURE_NO_TITLE);
		setContentView(R.layout.video_player);
		
		videoView = (VideoView)findViewById(R.id.video);
		

		MediaController mediaController = new MediaController(this);
		mediaController.setAnchorView(videoView);
		Uri video = Uri.parse("android.resource://" + getPackageName() + "/raw/jangsoo" );
		videoView.setMediaController(mediaController);
		videoView.setVideoURI(video);
		videoView.requestFocus();
		videoView.start();
		videoView.setOnCompletionListener(this);
	}
	@Override
	public void onCompletion(MediaPlayer mp) {
		finish();
	}
}
